<!DOCTYPE html>
<html>
<head>
    <title>核销卡券</title>
<include file="Public/head"/>
</head>
<body>
    <div id="wrapper">
	<include file="Public/leftmenu"/>
        <div id="page-wrapper" class="gray-bg">
<include file="Public/top"/>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>核销卡券</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a>Coupon</a>
                        </li>
                        <li class="active">
                            <strong>卡券验证</strong>
                        </li>
                    </ol>
                </div>
                <div class="col-lg-2">

                </div>
            </div>
       	 	<div class="wrapper wrapper-content animated fadeIn">
            	<div class="row">
                	<div class="col-lg-6">
                	    <div class="tabs-container weixin">
                	        <ul class="nav nav-tabs">
                	            <li class="active"><a data-toggle="tab" href="#tab-1">线下核销</a></li>
                	            <!---<li class=""><a data-toggle="tab" href="#tab-2">扫ee码退款</a></li>-->
                	        </ul>
                	        <div class="tab-content">
                	            <div id="tab-1" class="tab-pane active">
                	                <div class="panel-body">
                	                    <div class="row">
                            				<div class="col-sm-12 consumeCard">
											
											<h3 class="m-t-none m-b">卡券核销</h3><p>代金券、体验券等等都在这里核销哦</p><p>输入核销码  核销该卡券.</p>
											<div class="form-group"><label>卡券核销Code</label><input   onkeyup="this.value=this.value.replace(/\D/g,'')"  id="tick" type="text" placeholder="输入获取code" name="tick" class="form-control"></div>
											<div><button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="button"  onclick="return checkc();"><strong>核销卡券</strong></button></div>
											</div>
                        				</div>
                	                </div>
                	            </div>
                	            <div id="tab-2" class="tab-pane">
                	                <div class="panel-body">
                	                    <div class="row">
                            				<div class="col-sm-12 micropayRefund"></div>
                        				</div>
                	                </div>
                	            </div>
                	        </div>
                	    </div>
                	</div>
            	</div>
        	</div>
	   <include file="Public/footer"/>
        </div>
    </div>
	<script>
		function checkc(){
			var tick = $("#tick").val();
			if(!tick)
			{
					swal("错误", "请输入卡券code :)", "error");return false;
			}
		   if(confirm('您是否要核销此券？')){
				$.ajax({
					url: "?s=Coupon/do_ticket",
					type: "POST",
					dataType: "json",
					data:{tick:tick},
					success: function(res){
						if(res.error==0){
							swal({
								title: "操作成功",
									text: res.msg,
									type: "success"
								}, function () {
									$("#tick").val('');
								});

						}else{
						   swal("错误", res.msg+" :)", "error");return false;
						}
					}
				});
		   }
		}
  
  

	</script>
</body>
</html>